<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>登入</title>
    <style>
        body {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
        body {
            -moz-osx-font-smoothing: grayscale;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
            background-color: #fff;
        }
        body, html {
            height: 100%;
        }
        #app {
            height: 100%;
            min-width: 1100px;
        }
        *, :after, :before {
            -webkit-box-sizing: inherit;
            box-sizing: inherit;
        }
        .register-image-background {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
        }
        img {
            border-style: none;
        }
        .el-card, .el-message {
            border-radius: 4px;
            overflow: hidden;
            border: 1px solid red;
        }
        .el-card {
            border: 1px solid #ebeef5;
            background-color: #fff;
            color: #303133;
            -webkit-transition: .3s;
            transition: .3s;
        }
        .login-card {
            height: 485px;
            width: auto;
            z-index: 100;
            margin-left: 940px;
            margin-top: 117px;
            width: 377px;
            background-color: #fff;
            border-radius: 8px;
        }
        .login-card .el-card__body {
            padding: 0 20px!important;
        }
        .el-card__body {
            padding: 20px;
        }
        .el-card {
            border: 1px solid #ebeef5;
            background-color: #fff;
            color: #303133;
            -webkit-transition: .3s;
            transition: .3s;
        }
        form {
            display: block;
            margin-top: 0em;
        }
        .login-card .el-card__body .el-form-item {
            margin: 30px 20px;
        }
        .login-title-item {
            text-align: center;
            margin-top: 30px;
        }
        .el-form-item {
            margin-bottom: 22px;
        }
        .login-card .el-card__body .el-form-item {
            margin: 30px 20px;
        }
        .el-form-item--medium .el-form-item__content, .el-form-item--medium .el-form-item__label {
            line-height: 36px;
        }
        .el-form-item__content {
            line-height: 40px;
            position: relative;
            font-size: 14px;
        }
        .el-input--medium {
            font-size: 14px;
        }
        .el-input {
            position: relative;
            font-size: 14px;
            display: inline-block;
            width: 100%;
        }
        .login-card .el-card__body .el-form-item .el-input .el-input__inner {
            border: 0!important;
            border-bottom: 1px solid #dcdfe6!important;
        }
        .el-input--medium .el-input__inner {
            height: 36px;
            line-height: 36px;
        }
        .el-input__inner {
            -webkit-appearance: none;
            background-color: #fff;
            background-image: none;
            border-radius: 4px;
            border: 1px solid #dcdfe6;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            color: #606266;
            display: inline-block;
            font-size: inherit;
            height: 40px;
            line-height: 40px;
            outline: 0;
            padding: 0 15px;
            -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
            transition: border-color .2s cubic-bezier(.645,.045,.355,1);
            width: 100%;
        }
        button, input {
            overflow: visible;
        }
        button, input, optgroup, select, textarea {
            font-family: inherit;
            font-size: 100%;
            line-height: 1.15;
            margin: 0;
        }
        input {
            -webkit-writing-mode: horizontal-tb !important;
            text-rendering: auto;
            letter-spacing: normal;
            word-spacing: normal;
            text-transform: none;
            text-indent: 0px;
            text-shadow: none;
            display: inline-block;
            text-align: start;
            appearance: auto;
            -webkit-rtl-ordering: logical;
            cursor: text;
            margin: 0em;
            font: 400 13.3333px Arial;
            padding: 1px 2px;
            border-width: 2px;
            border-style: inset;
            border-image: initial;
            border-radius: 2px;
        }
        .el-form-item__content {
            line-height: 40px;
            position: relative;
            font-size: 14px;
        }
        .form-title, .login-register-link {
            text-align: center;
        }
        .form-title {
            color: #4c596b;
            font-size: 15px;
            line-height: 40px;
            margin-top: 10px;
            height: 50px;
            margin-bottom: 20px;
        }
        .login-card .el-card__body .el-form-item {
            margin: 30px 20px;
        }
        .el-form-item {
            margin-bottom: 22px;
        }
        .el-form-item--medium .el-form-item__content, .el-form-item--medium .el-form-item__label {
            line-height: 36px;
        }
        .el-form-item__content {
            line-height: 40px;
            position: relative;
            font-size: 14px;
        }
        .el-input--medium {
            font-size: 14px;
        }

        .el-input {
            position: relative;
            font-size: 14px;
            display: inline-block;
            width: 100%;
        }
        .login-card .el-card__body .el-form-item .el-input .el-input__inner {
            border: 0!important;
            border-bottom: 1px solid #dcdfe6!important;
        }
        .el-input--medium .el-input__inner {
            height: 36px;
            line-height: 36px;
        }
        .login-card .el-card__body .login-kaptcha {
            margin-bottom: 0;
        }

        .login-card .el-card__body .el-form-item {
            margin: 30px 20px;
        }
        .el-form-item {
            margin-bottom: 22px;
        }
        .login-back, .login-card .el-card__body .login-kaptcha .el-form-item__content {
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
        }
        .el-form-item--medium .el-form-item__content, .el-form-item--medium .el-form-item__label {
            line-height: 36px;
        }
        .el-form-item__content {
            line-height: 40px;
            position: relative;
            font-size: 14px;
        }
        .el-input--medium {
            font-size: 14px;
        }

        .el-input {
            position: relative;
            font-size: 14px;
            display: inline-block;
            width: 100%;
        }
        .login-card .el-card__body .el-form-item .el-input .el-input__inner {
            border: 0!important;
            border-bottom: 1px solid #dcdfe6!important;
        }
        .el-input--medium .el-input__inner {
            height: 36px;
            line-height: 36px;
        }
        img {
            border-style: none;
        }
        .login-card .el-card__body .el-form-item {
            margin: 30px 20px;
        }

        .login-forget {
            margin: 10px!important;
            text-align: right!important;
        }
        .el-form-item {
            margin-bottom: 22px;
        }
        .el-form-item--medium .el-form-item__content, .el-form-item--medium .el-form-item__label {
            line-height: 36px;
        }

        .el-form-item__content {
            line-height: 40px;
            position: relative;
            font-size: 14px;
        }
        .login-link {
            color: #8bc53e;
            cursor: pointer;
            outline: 0;
            text-decoration: none;
        }
        .el-form-item--medium .el-form-item__content, .el-form-item--medium .el-form-item__label {
            line-height: 36px;
        }

        .el-form-item__content {
            line-height: 40px;
            position: relative;
            font-size: 14px;
        }
        element.style {
            width: 100%;
        }
        .login-submit {
            text-align: center;
            width: 100%;
            border-radius: 5px;
            background-color: #3ea3c6;
            border: 0;
            position: relative;
            outline: 0;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            height: 50px;
        }

        .login-card .el-card__body .el-form-item {
            margin: 30px 20px;
        }

        .form-title, .login-register-link {
            text-align: center;
        }
        .el-form-item {
            margin-bottom: 22px;
        }
        .el-form-item--medium .el-form-item__content, .el-form-item--medium .el-form-item__label {
            line-height: 36px;
        }

        .el-form-item__content {
            line-height: 40px;
            position: relative;
            font-size: 14px;
        }
        .login-link {
            color: #8bc53e;
            cursor: pointer;
            outline: 0;
            text-decoration: none;
        }

        a {
            background-color: transparent;
        }
    </style>
</head>
<body>
<div id="app">
    <div class="login-back">
        <img src="../images/background.5f3d18b4.png" class="register-image-background">
        <div class="el-card login-card is-none-shadow">
            <div class="el-card__body">
                <form class="el-form" action="/examproject/no/login" method="post" id="myfo" onsubmit="return pd(this)">
                    <div class="el-form-item login-title-item el-form-item--medium">
                        <div class="el-form-item__content">
                            <span class="form-title">九云考试系统登录</span><br>
                            <select onchange="text()" id="pid">
                                <option value="学生登录">学生登录</option>
                                <option value="老师登录" >老师登录</option>
                            </select>
                        </div>
                    </div>
                    <div class="el-form-item is-required el-form-item--medium">
                        <div class="el-form-item__content">
                            <div class="el-input el-input--medium">
                                <input type="text" name="stname" autocomplete="on" placeholder="请输入用户名" class="el-input__inner">
                            </div>
                        </div>
                    </div>
                    <div class="el-form-item is-required el-form-item--medium">
                        <div class="el-form-item__content">
                            <div class="el-input el-input--medium">
                                <input type="password" name="stpass" autocomplete="on" placeholder="请输入密码" class="el-input__inner">
                            </div>
                        </div>
                    </div>
                    <div class="el-form-item login-kaptcha is-required el-form-item--medium">
                        <div class="el-form-item__content">
                            <div class="el-input el-input--medium">
                                <input type="text" name="yzm" autocomplete="on" id="code" placeholder="请输入验证码" class="el-input__inner">
                            </div>
                            <div id="yzm" onclick="yzm()"></div>
                        </div>
                    </div>
                    <div class="el-form-item login-forget el-form-item--medium">
                        <div class="el-form-item__content">
                            <a href="/examproject/nologin/getpass.jsp" class="login-link"> 忘记密码 </a>
                        </div>
                    </div>
                    <div class="el-form-item el-form-item--medium" style="margin-top: 5px;">
                        <div class="el-form-item__content">
<button type="submit" value="登录" class="login-submit" style="width: 100%;">登录</button>
                        </div>
                    </div>
                    <div class="el-form-item login-register-link el-form-item--medium">
                        <div class="el-form-item__content">
                            <span>没有账号？</span>
                            <a href="Register.jsp" class="login-link"> 注册 </a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var msg =<%=request.getParameter("msg")%>;
    if(msg==false){
        alert("用户名或密码错误,请重新输入");
    }
    var code;
    window.onload=function(){
        code = "";
        var sjs = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd',
            'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
            'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
        for (var i = 0; i < 4; i++) {
            code += sjs[Math.floor(Math.random() * 36)];
        }
        var yzm1 = document.getElementById("yzm");
        yzm1.style.color = "green";
        //设置字体间距
        yzm1.style.letterSpacing = "5px";
        //设置字体样式
        yzm1.style.fontFamily = "fixedsys";
        yzm1.innerHTML = code;
    }
    function yzm() {
        code = "";
        var sjs = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd',
            'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
            'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
        for (var i = 0; i < 4; i++) {
            code += sjs[Math.floor(Math.random() * 36)];
        }
        var yzm1 = document.getElementById("yzm");
        yzm1.style.color = "green";
        //设置字体间距
        yzm1.style.letterSpacing = "5px";
        //设置字体样式
        yzm1.style.fontFamily = "fixedsys";
        yzm1.innerHTML = code;
    }
    function text() {

        var obj = document.getElementById("pid");
       /* alert(obj.options[obj.selectedIndex].value)*/
        if (obj.options[obj.selectedIndex].value=="老师登录"){
            var myfo=document.getElementById("myfo");
            myfo.action="/examproject/no/login2";
        }else{
            var myfo=document.getElementById("myfo");
            myfo.action="/examproject/no/login";
        }

    }
    function pd() {
        var yzm=document.getElementById("code").value;
        var yzm1=document.getElementById("yzm").innerText;
        if(yzm!=yzm1){
            alert("验证码错误");
            yzm.innerHTML="";
            code = "";
            var sjs = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd',
                'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
                'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
            for (var i = 0; i < 4; i++) {
                code += sjs[Math.floor(Math.random() * 36)];
            }
            var yzm1 = document.getElementById("yzm");
            yzm1.style.color = "green";
            //设置字体间距
            yzm1.style.letterSpacing = "5px";
            //设置字体样式
            yzm1.style.fontFamily = "fixedsys";
            yzm1.innerHTML = code;
            return false;
        }
        return true;
    }
</script>

</body>
</html>
